// function Welcome(props){
//     return <p>welcome,{props.name}</p>
// }
import React, { Fragment } from "react";
import { CSSTransition } from 'react-transition-group';
class Welcome extends React.Component{
    constructor(props){
        super(props);
        this.state={
            show:true
        }
        this.toggleHandle = this.toggleHandle.bind(this)
    }
    render(){
        return (
            <Fragment>
                <p className={this.state.show?'show':'hide'}> welcome,class类传值,{this.props.name}</p>
                <button onClick={this.toggleHandle}>toggle</button>
            </Fragment>           
        )
    }
    toggleHandle(){
        this.setState(()=>({
            show:this.state.show?false:true
        }))
    }
}

export default Welcome